

<template>
  <div class="app-container">
    <!--    表单搜索-->
    <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="60px">
      <el-form-item label="用户名" prop="userName">
        <el-input
          v-model="queryParams.userName"
          placeholder="请输入用户名搜索"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <!--   0-待审核 1-审核成功 2-审核失败  -->
      <el-form-item label="状态" prop="withdrawalStatus">
        <el-select v-model="queryParams.withdrawalStatus" placeholder="全部状态" clearable size="small">
<!--          <el-option v-for="item in [{value: '0', label: '待审核' }, {value: '1', label: '审核成功' },{value: '2', label: '审核失败' }]"-->
<!--                     :key="item.value" :label="item.label" :value="item.value" />-->
          <el-option v-for="item in sysOptions"
                     :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue" />
        </el-select>
      </el-form-item>
      <!--            range-separator="至"-->
      <el-form-item label="时间" >
        <div class="block">
          <el-date-picker
            v-model="dateRange"
            size="small"
            style="width: 240px"
            value-format="yyyy-MM-dd"
            type="daterange"
            range-separator="-"
            start-placeholder="开始日期"
            end-placeholder="结束日期">
          </el-date-picker>
        </div>
      </el-form-item>


      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>





    <el-row :gutter="10" class="mb8">
      <!--      <el-col :span="1.5">-->
      <!--        <el-button-->
      <!--          type="primary"-->
      <!--          icon="el-icon-plus"-->
      <!--          size="mini"-->
      <!--          @click="handleAdd"-->
      <!--          v-hasPermi="['system:withdrawal:add']"-->
      <!--        >新增</el-button>-->
      <!--      </el-col>-->
      <!--      <el-col :span="1.5">-->
      <!--        <el-button-->
      <!--          type="success"-->
      <!--          icon="el-icon-edit"-->
      <!--          size="mini"-->
      <!--          :disabled="single"-->
      <!--          @click="handleUpdate"-->
      <!--          v-hasPermi="['system:withdrawal:edit']"-->
      <!--        >修改</el-button>-->
      <!--      </el-col>-->
      <!--      <el-col :span="1.5">-->
      <!--        <el-button-->
      <!--          type="danger"-->
      <!--          icon="el-icon-delete"-->
      <!--          size="mini"-->
      <!--          :disabled="multiple"-->
      <!--          @click="handleDelete"-->
      <!--          v-hasPermi="['system:withdrawal:remove']"-->
      <!--        >删除</el-button>-->
      <!--      </el-col>-->
      <!--      <el-col :span="1.5">-->
      <!--        <el-button-->
      <!--          type="warning"-->
      <!--          icon="el-icon-download"-->
      <!--          size="mini"-->
      <!--          @click="handleExport"-->
      <!--          v-hasPermi="['system:withdrawal:export']"-->
      <!--        >导出</el-button>-->
      <!--      </el-col>-->
    </el-row>

    <el-table v-loading="loading" :data="withdrawalList" >
      <!--      <el-table-column type="selection" width="55" align="center" />     @selection-change="handleSelectionChange"-->
      <el-table-column label="用户名" align="center" prop="userName" />
      <el-table-column label="银行卡号" align="center" prop="bankId" />
      <el-table-column label="实际到账金额" align="center" prop="factMoney" />
      <el-table-column label="申请提现金额" align="center" prop="money" />
      <!--      0-待审核 1-审核成功 2-审核失败-->
<!--      <el-table-column label="提现审核状态 " align="center" prop="statusName" />-->
      <el-table-column label="提现审核状态 " align="center" prop="withdrawalStatus" :formatter="sysFormat"/>
      <el-table-column label="审核失败原因" align="center" prop="reason" />
<!--      <el-table-column label="备注" align="center" prop="createTime" width="180">-->
<!--        <template slot-scope="scope">-->
<!--          <span>{{ parseTime(scope.row.createTime) }}</span>-->
<!--        </template>-->
<!--      </el-table-column>-->
      <el-table-column label="备注" align="center" prop="remark" width="180" />
<!--        <template slot-scope="scope">-->
<!--          <span>{{ parseTime(scope.row.createTime) }}</span>-->
<!--        </template>-->
<!--      </el-table-column>-->


      <el-table-column label="创建时间" align="center" prop="createTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createTime) }}</span>
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button  v-if="scope.row.withdrawalStatus=='0'"
                      size="mini"
                      type="text"
                      icon="el-icon-edit"
                      @click="handleUpdate(scope.row)"
                      v-hasPermi="['system:withdrawal2:edit']"
          >审核</el-button>
          <!--          <el-button-->
          <!--            size="mini"-->
          <!--            type="text"-->
          <!--            icon="el-icon-delete"-->
          <!--            @click="handleDelete(scope.row)"-->
          <!--            v-hasPermi="['system:withdrawal:remove']"-->
          <!--          >删除</el-button>-->
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改申请提现对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px">

      <el-form ref="submitForm" :model="form"  label-width="100px"  :rules="rules">

        <el-form-item label="银行卡号" >
          <el-input v-model="form.bankId" placeholder="请输入银行卡id"  disabled/>
        </el-form-item>

        <el-form-item label="实际到账金额"  >
          <el-input v-model="form.factMoney" placeholder="请输入实际到账金额"  disabled/>
        </el-form-item>

        <!--   0-待审核 1-审核成功 2-审核失败  -->
        <!--<el-form-item label="审核状态" >-->
          <!--<el-select v-model="form.withdrawalStatus" placeholder="全部状态"  size="small">-->
<!--&lt;!&ndash;            <el-option v-for="item in [{value: '0', label: '待审核'  ,disabled: true},{value: '1', label: '审核成功' },{value: '2', label: '审核失败' }]"&ndash;&gt;-->
<!--&lt;!&ndash;                       :key="item.value" :label="item.label" :value="item.value"  :disabled="item.disabled"/>&ndash;&gt;-->
            <!--<el-option v-for="item in sysOptions"-->
                       <!--:key="item.dictValue" :label="item.dictLabel" :value="item.dictValue" />-->
          <!--</el-select>-->
        <!--</el-form-item>-->


        <!--        v-show="form.withdrawalStatus=='2'"-->
        <el-form-item label="审核失败原因"   prop="reason">
          <el-input v-model="form.reason" placeholder="请输入审核失败原因"  type="textarea"    :autosize="{ minRows: 2, maxRows: 4}"/>
        </el-form-item>


      </el-form>


      <div slot="footer" class="dialog-footer" style="margin-bottom: 30px">
        <el-button style="float: left;" type="primary" @click="submitForm('submitForm')">审核成功</el-button>
        <el-button style="float: right;" @click="submitForm1('submitForm')">审核失败</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
  // import { listWithdrawal, getWithdrawal, delWithdrawal, addWithdrawal, updateWithdrawal, exportWithdrawal } from "@/api/system/withdrawal";
  import { listWithdrawal2, getWithdrawal2, delWithdrawal2, addWithdrawal2, updateWithdrawal2, exportWithdrawal2 } from "@/api/system/withdrawal2";
  export default {
    name: "Withdrawal",
    watch:{
      'dateRange':{
        handler: function(newVal, oldVal) { //操作者
          console.log(newVal)
          // this.queryParams.beginTime = newVal[0]
          // this.queryParams.endTime = newVal[1]
        },
      }
    },
    data() {
      return {
        dateRange:[],
        pickerOptions: {
          shortcuts: [{
            text: '最近一周',
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
              picker.$emit('pick', [start, end]);
            }
          }, {
            text: '最近一个月',
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
              picker.$emit('pick', [start, end]);
            }
          }, {
            text: '最近三个月',
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
              picker.$emit('pick', [start, end]);
            }
          }]},
        rules: {
          type: [
            { required: true, message: '请输入审核失败原因！', trigger: 'blur' }
          ],
        },
        // 遮罩层
        loading: true,
        // 选中数组
        ids: [],
        // 非单个禁用
        single: true,
        // 非多个禁用
        multiple: true,
        // 总条数
        total: 0,
        // 申请提现表格数据
        withdrawalList: [],
        // 弹出层标题
        title: "",
        // 是否显示弹出层
        open: false,
        // 查询参数
        queryParams: {
          pageNum: 1,
          pageSize: 10,
          // withdrawalId: undefined,
          // userId: undefined,
          // bankId: undefined,
          // factMoney: undefined,
          // money: undefined,
          // withdrawalStatus: undefined,
          // reason: undefined,
          // createTime: undefined,
        },
        // 表单参数
        form: {},
        // 修改表单
        editForm: {},
        sysOptions:[]
      };
    },
    created() {
      // sys_audit_status
      this.getDicts("sys_audit_status").then(response => {
        console.log(response)
        this.sysOptions = response.data;
      });
      this.getList();
    },
    methods: {
      sysFormat(row, column) {
        return this.selectDictLabel(this.sysOptions, row.withdrawalStatus);
      },
//
      /** 查询申请提现列表 */
      getList() {
        this.loading = true;
        // console.log('查询申请提现列表参数', this.addDateRange(this.queryParams, this.dateRange))
        listWithdrawal2( this.addDateRange(this.queryParams, this.dateRange)).then(response => {
          // this.addDateRange(this.queryParams, this.dateRange)
          // listWithdrawal(this.queryParams,this.dateRange).then(response => {
          console.log('整体列表',response)
          //0-待审核 1-审核成功 2-审核失败
          response.rows.forEach((items,i)=>{
            if(items.withdrawalStatus == "0"){
              items.statusName = "待审核"
            } else if(items.withdrawalStatus == "1"){
              items.statusName = "审核成功"
            }else if(items.withdrawalStatus == "2"){
              items.statusName = "审核失败"
            }
          })

          this.withdrawalList = response.rows;
          this.total = response.total;
          this.loading = false;
        });
      },
      // 取消按钮
      cancel() {
        this.open = false;
        this.reset();
      },
      // 表单重置
      reset() {
        this.form = {
          bankId: undefined,
          createTime:undefined,
          factMoney: undefined,
          money: undefined,
          reason: undefined,
          // statusName: "待审核",
          updateTime: undefined,
          userId: undefined,
          userName: undefined,
          withdrawalId: undefined,
          withdrawalStatus: undefined,
          // withdrawalId: undefined,
          // userId: undefined,
          // bankId: undefined,
          // factMoney: undefined,
          // money: undefined,
          // withdrawalStatus: "",
          // reason: undefined,
          // createTime: undefined,
          // remark: undefined,
          // createBy: undefined,
          // createTime2: undefined,
          // updateBy: undefined,
          // updateTime: undefined
        };
        this.resetForm("form");
        this.getList();
      },
      /** 搜索按钮操作 */
      handleQuery() {
        this.queryParams.pageNum = 1;
        this.getList();
      },
      /** 重置按钮操作 */
      resetQuery() {
        this.resetForm("queryForm");
        this.handleQuery();
      },
      // 多选框选中数据
      handleSelectionChange(selection) {
        this.ids = selection.map(item => item.withdrawalId)
        this.single = selection.length!=1
        this.multiple = !selection.length
      },
      /** 新增按钮操作 */
      handleAdd() {
        this.reset();
        this.open = true;
        this.title = "添加申请提现";
      },
      /** 修改按钮操作 */
      handleUpdate(row) {
        // this.reset();
        const withdrawalId = row.withdrawalId || this.ids
        this.form.updateWithdrawal = '1'
        getWithdrawal2(withdrawalId).then(response => {
          console.log('修改列表获取',response.data)
          this.form = response.data;
          this.open = true;
          this.title = "修改申请提现";
          // this.reset()
        });
      },
      /** 提交按钮 */
      submitForm: function(formName) {
        this.form.withdrawalStatus = 1;
        this.$refs[formName].validate(valid => {
          // 0-待审核 1-审核成功 2-审核失败
          if (this.form.withdrawalStatus=='2') {
            //审核失败
            // alert('submit!');
            if (!!this.form.reason){
              console.log('修改传的参数',this.form)
              updateWithdrawal2(this.form).then(response => {
                if (response.code === 200) {
                  console.log('修改成功返回值' ,response)
                  this.msgSuccess("操作成功");
                  this.form.withdrawalStatus = ''
                  this.open = false;
                  // this.getList();
                  this.reset()
                } else {
                  this.msgError(response.msg);
                }
              });
            }else {
              this.msgError("申请不通过，失败原因不能为空！")
            }

          } else {
            console.log('修改传的参数',this.form)
            updateWithdrawal2(this.form).then(response => {
              if (response.code === 200) {
                console.log('修改成功返回值' ,response)
                this.msgSuccess("操作成功");
                this.form.withdrawalStatus = ''
                this.open = false;
                // this.getList();
                this.reset()
              } else {
                this.msgError(response.msg);
              }
            });
          }



        });
      },
      submitForm1: function(formName) {
        this.form.withdrawalStatus = 2;
        this.$refs[formName].validate(valid => {
          // 0-待审核 1-审核成功 2-审核失败
          if (this.form.withdrawalStatus=='2') {
            //审核失败
            // alert('submit!');
            if (!!this.form.reason){
              console.log('修改传的参数',this.form)
              updateWithdrawal2(this.form).then(response => {
                if (response.code === 200) {
                  console.log('修改成功返回值' ,response)
                  this.msgSuccess("操作成功");
                  this.form.withdrawalStatus = ''
                  this.open = false;
                  // this.getList();
                  this.reset()
                } else {
                  this.msgError(response.msg);
                }
              });
            }else {
              this.msgError("申请不通过，失败原因不能为空！")
            }

          } else {
            console.log('修改传的参数',this.form)
            updateWithdrawal2(this.form).then(response => {
              if (response.code === 200) {
                console.log('修改成功返回值' ,response)
                this.msgSuccess("操作成功");
                this.form.withdrawalStatus = ''
                this.open = false;
                // this.getList();
                this.reset()
              } else {
                this.msgError(response.msg);
              }
            });
          }



        });
      },
      /** 删除按钮操作 */
      handleDelete(row) {
        const withdrawalIds = row.withdrawalId || this.ids;
        this.$confirm('是否确认删除申请提现编号为"' + withdrawalIds + '"的数据项?', "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(function() {
          return delWithdrawal2(withdrawalIds);
        }).then(() => {
          this.getList();
          this.msgSuccess("删除成功");
        }).catch(function() {});
      },
      /** 导出按钮操作 */
      handleExport() {
        const queryParams = this.queryParams;
        this.$confirm('是否确认导出所有申请提现数据项?', "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(function() {
          return exportWithdrawal2(queryParams);
        }).then(response => {
          this.download(response.msg);
        }).catch(function() {});
      }
    }
  };
</script>






































<!--<template>-->
<!--  <div class="app-container">-->
<!--    <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">-->
<!--      <el-form-item label="用户id" prop="withdrawalId">-->
<!--        <el-input-->
<!--          v-model="queryParams.withdrawalId"-->
<!--          placeholder="请输入用户id"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="用户id" prop="mobileUserId">-->
<!--        <el-input-->
<!--          v-model="queryParams.mobileUserId"-->
<!--          placeholder="请输入用户id"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="银行卡id" prop="bankId">-->
<!--        <el-input-->
<!--          v-model="queryParams.bankId"-->
<!--          placeholder="请输入银行卡id"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="实际到账金额" prop="factMoney">-->
<!--        <el-input-->
<!--          v-model="queryParams.factMoney"-->
<!--          placeholder="请输入实际到账金额"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="申请提现金额" prop="money">-->
<!--        <el-input-->
<!--          v-model="queryParams.money"-->
<!--          placeholder="请输入申请提现金额"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="提现审核状态 0-待审核 1-审核成功 2-审核失败" prop="withdrawalStatus">-->
<!--        <el-select v-model="queryParams.withdrawalStatus" placeholder="请选择提现审核状态 0-待审核 1-审核成功 2-审核失败" clearable size="small">-->
<!--          <el-option label="请选择字典生成" value="" />-->
<!--        </el-select>-->
<!--      </el-form-item>-->
<!--      <el-form-item label="审核失败原因" prop="reason">-->
<!--        <el-input-->
<!--          v-model="queryParams.reason"-->
<!--          placeholder="请输入审核失败原因"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="审核失败原因" prop="createTime2">-->
<!--        <el-date-picker clearable size="small" style="width: 200px"-->
<!--          v-model="queryParams.createTime2"-->
<!--          type="date"-->
<!--          value-format="yyyy-MM-dd"-->
<!--          placeholder="选择审核失败原因">-->
<!--        </el-date-picker>-->
<!--      </el-form-item>-->
<!--      <el-form-item>-->
<!--        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>-->
<!--        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>-->
<!--      </el-form-item>-->
<!--    </el-form>-->

<!--    <el-row :gutter="10" class="mb8">-->
<!--      <el-col :span="1.5">-->
<!--        <el-button-->
<!--          type="primary"-->
<!--          icon="el-icon-plus"-->
<!--          size="mini"-->
<!--          @click="handleAdd"-->
<!--          v-hasPermi="['system:withdrawal2:add']"-->
<!--        >新增</el-button>-->
<!--      </el-col>-->
<!--      <el-col :span="1.5">-->
<!--        <el-button-->
<!--          type="success"-->
<!--          icon="el-icon-edit"-->
<!--          size="mini"-->
<!--          :disabled="single"-->
<!--          @click="handleUpdate"-->
<!--          v-hasPermi="['system:withdrawal2:edit']"-->
<!--        >修改</el-button>-->
<!--      </el-col>-->
<!--      <el-col :span="1.5">-->
<!--        <el-button-->
<!--          type="danger"-->
<!--          icon="el-icon-delete"-->
<!--          size="mini"-->
<!--          :disabled="multiple"-->
<!--          @click="handleDelete"-->
<!--          v-hasPermi="['system:withdrawal2:remove']"-->
<!--        >删除</el-button>-->
<!--      </el-col>-->
<!--      <el-col :span="1.5">-->
<!--        <el-button-->
<!--          type="warning"-->
<!--          icon="el-icon-download"-->
<!--          size="mini"-->
<!--          @click="handleExport"-->
<!--          v-hasPermi="['system:withdrawal2:export']"-->
<!--        >导出</el-button>-->
<!--      </el-col>-->
<!--    </el-row>-->

<!--    <el-table v-loading="loading" :data="withdrawal2List" @selection-change="handleSelectionChange">-->
<!--      <el-table-column type="selection" width="55" align="center" />-->
<!--      <el-table-column label="用户id" align="center" prop="withdrawalId" />-->
<!--      <el-table-column label="用户id" align="center" prop="mobileUserId" />-->
<!--      <el-table-column label="银行卡id" align="center" prop="bankId" />-->
<!--      <el-table-column label="实际到账金额" align="center" prop="factMoney" />-->
<!--      <el-table-column label="申请提现金额" align="center" prop="money" />-->
<!--      <el-table-column label="提现审核状态 0-待审核 1-审核成功 2-审核失败" align="center" prop="withdrawalStatus" />-->
<!--      <el-table-column label="审核失败原因" align="center" prop="reason" />-->
<!--      <el-table-column label="备注" align="center" prop="remark" />-->
<!--      <el-table-column label="备注" align="center" prop="createTime2" width="180">-->
<!--        <template slot-scope="scope">-->
<!--          <span>{{ parseTime(scope.row.createTime2) }}</span>-->
<!--        </template>-->
<!--      </el-table-column>-->
<!--      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
<!--        <template slot-scope="scope">-->
<!--          <el-button-->
<!--            size="mini"-->
<!--            type="text"-->
<!--            icon="el-icon-edit"-->
<!--            @click="handleUpdate(scope.row)"-->
<!--            v-hasPermi="['system:withdrawal2:edit']"-->
<!--          >修改</el-button>-->
<!--          <el-button-->
<!--            size="mini"-->
<!--            type="text"-->
<!--            icon="el-icon-delete"-->
<!--            @click="handleDelete(scope.row)"-->
<!--            v-hasPermi="['system:withdrawal2:remove']"-->
<!--          >删除</el-button>-->
<!--        </template>-->
<!--      </el-table-column>-->
<!--    </el-table>-->
<!--    -->
<!--    <pagination-->
<!--      v-show="total>0"-->
<!--      :total="total"-->
<!--      :page.sync="queryParams.pageNum"-->
<!--      :limit.sync="queryParams.pageSize"-->
<!--      @pagination="getList"-->
<!--    />-->

<!--    &lt;!&ndash; 添加或修改用户申请提现对话框 &ndash;&gt;-->
<!--    <el-dialog :title="title" :visible.sync="open" width="500px">-->
<!--      <el-form ref="form" :model="form" :rules="rules" label-width="80px">-->
<!--        <el-form-item label="用户id" prop="withdrawalId">-->
<!--          <el-input v-model="form.withdrawalId" placeholder="请输入用户id" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="用户id" prop="mobileUserId">-->
<!--          <el-input v-model="form.mobileUserId" placeholder="请输入用户id" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="银行卡id" prop="bankId">-->
<!--          <el-input v-model="form.bankId" placeholder="请输入银行卡id" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="实际到账金额" prop="factMoney">-->
<!--          <el-input v-model="form.factMoney" placeholder="请输入实际到账金额" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="申请提现金额" prop="money">-->
<!--          <el-input v-model="form.money" placeholder="请输入申请提现金额" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="提现审核状态 0-待审核 1-审核成功 2-审核失败">-->
<!--          <el-radio-group v-model="form.withdrawalStatus">-->
<!--            <el-radio label="1">请选择字典生成</el-radio>-->
<!--          </el-radio-group>-->
<!--        </el-form-item>-->
<!--        <el-form-item label="审核失败原因" prop="reason">-->
<!--          <el-input v-model="form.reason" placeholder="请输入审核失败原因" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="审核失败原因" prop="createTime2">-->
<!--          <el-date-picker clearable size="small" style="width: 200px"-->
<!--            v-model="form.createTime2"-->
<!--            type="date"-->
<!--            value-format="yyyy-MM-dd"-->
<!--            placeholder="选择审核失败原因">-->
<!--          </el-date-picker>-->
<!--        </el-form-item>-->
<!--      </el-form>-->
<!--      <div slot="footer" class="dialog-footer">-->
<!--        <el-button type="primary" @click="submitForm">确 定</el-button>-->
<!--        <el-button @click="cancel">取 消</el-button>-->
<!--      </div>-->
<!--    </el-dialog>-->
<!--  </div>-->
<!--</template>-->

<!--<script>-->
<!--import { listWithdrawal2, getWithdrawal2, delWithdrawal2, addWithdrawal2, updateWithdrawal2, exportWithdrawal2 } from "@/api/system/withdrawal2";-->

<!--export default {-->
<!--  name: "Withdrawal2",-->
<!--  data() {-->
<!--    return {-->
<!--      // 遮罩层-->
<!--      loading: true,-->
<!--      // 选中数组-->
<!--      ids: [],-->
<!--      // 非单个禁用-->
<!--      single: true,-->
<!--      // 非多个禁用-->
<!--      multiple: true,-->
<!--      // 总条数-->
<!--      total: 0,-->
<!--      // 用户申请提现表格数据-->
<!--      withdrawal2List: [],-->
<!--      // 弹出层标题-->
<!--      title: "",-->
<!--      // 是否显示弹出层-->
<!--      open: false,-->
<!--      // 查询参数-->
<!--      queryParams: {-->
<!--        pageNum: 1,-->
<!--        pageSize: 10,-->
<!--        withdrawalId: undefined,-->
<!--        mobileUserId: undefined,-->
<!--        bankId: undefined,-->
<!--        factMoney: undefined,-->
<!--        money: undefined,-->
<!--        withdrawalStatus: undefined,-->
<!--        reason: undefined,-->
<!--        createTime2: undefined,-->
<!--      },-->
<!--      // 表单参数-->
<!--      form: {},-->
<!--      // 表单校验-->
<!--      rules: {-->
<!--      }-->
<!--    };-->
<!--  },-->
<!--  created() {-->
<!--    this.getList();-->
<!--  },-->
<!--  methods: {-->
<!--    /** 查询用户申请提现列表 */-->
<!--    getList() {-->
<!--      this.loading = true;-->
<!--      listWithdrawal2(this.queryParams).then(response => {-->
<!--        this.withdrawal2List = response.rows;-->
<!--        this.total = response.total;-->
<!--        this.loading = false;-->
<!--      });-->
<!--    },-->
<!--    // 取消按钮-->
<!--    cancel() {-->
<!--      this.open = false;-->
<!--      this.reset();-->
<!--    },-->
<!--    // 表单重置-->
<!--    reset() {-->
<!--      this.form = {-->
<!--        withdrawalId: undefined,-->
<!--        mobileUserId: undefined,-->
<!--        bankId: undefined,-->
<!--        factMoney: undefined,-->
<!--        money: undefined,-->
<!--        withdrawalStatus: "0",-->
<!--        reason: undefined,-->
<!--        createTime: undefined,-->
<!--        remark: undefined,-->
<!--        createBy: undefined,-->
<!--        createTime2: undefined,-->
<!--        updateBy: undefined,-->
<!--        updateTime: undefined-->
<!--      };-->
<!--      this.resetForm("form");-->
<!--    },-->
<!--    /** 搜索按钮操作 */-->
<!--    handleQuery() {-->
<!--      this.queryParams.pageNum = 1;-->
<!--      this.getList();-->
<!--    },-->
<!--    /** 重置按钮操作 */-->
<!--    resetQuery() {-->
<!--      this.resetForm("queryForm");-->
<!--      this.handleQuery();-->
<!--    },-->
<!--    // 多选框选中数据-->
<!--    handleSelectionChange(selection) {-->
<!--      this.ids = selection.map(item => item.withdrawalId)-->
<!--      this.single = selection.length!=1-->
<!--      this.multiple = !selection.length-->
<!--    },-->
<!--    /** 新增按钮操作 */-->
<!--    handleAdd() {-->
<!--      this.reset();-->
<!--      this.open = true;-->
<!--      this.title = "添加用户申请提现";-->
<!--    },-->
<!--    /** 修改按钮操作 */-->
<!--    handleUpdate(row) {-->
<!--      this.reset();-->
<!--      const withdrawalId = row.withdrawalId || this.ids-->
<!--      getWithdrawal2(withdrawalId).then(response => {-->
<!--        this.form = response.data;-->
<!--        this.open = true;-->
<!--        this.title = "修改用户申请提现";-->
<!--      });-->
<!--    },-->
<!--    /** 提交按钮 */-->
<!--    submitForm: function() {-->
<!--      this.$refs["form"].validate(valid => {-->
<!--        if (valid) {-->
<!--          if (this.form.withdrawalId != undefined) {-->
<!--            updateWithdrawal2(this.form).then(response => {-->
<!--              if (response.code === 200) {-->
<!--                this.msgSuccess("修改成功");-->
<!--                this.open = false;-->
<!--                this.getList();-->
<!--              } else {-->
<!--                this.msgError(response.msg);-->
<!--              }-->
<!--            });-->
<!--          } else {-->
<!--            addWithdrawal2(this.form).then(response => {-->
<!--              if (response.code === 200) {-->
<!--                this.msgSuccess("新增成功");-->
<!--                this.open = false;-->
<!--                this.getList();-->
<!--              } else {-->
<!--                this.msgError(response.msg);-->
<!--              }-->
<!--            });-->
<!--          }-->
<!--        }-->
<!--      });-->
<!--    },-->
<!--    /** 删除按钮操作 */-->
<!--    handleDelete(row) {-->
<!--      const withdrawalIds = row.withdrawalId || this.ids;-->
<!--      this.$confirm('是否确认删除用户申请提现编号为"' + withdrawalIds + '"的数据项?', "警告", {-->
<!--          confirmButtonText: "确定",-->
<!--          cancelButtonText: "取消",-->
<!--          type: "warning"-->
<!--        }).then(function() {-->
<!--          return delWithdrawal2(withdrawalIds);-->
<!--        }).then(() => {-->
<!--          this.getList();-->
<!--          this.msgSuccess("删除成功");-->
<!--        }).catch(function() {});-->
<!--    },-->
<!--    /** 导出按钮操作 */-->
<!--    handleExport() {-->
<!--      const queryParams = this.queryParams;-->
<!--      this.$confirm('是否确认导出所有用户申请提现数据项?', "警告", {-->
<!--          confirmButtonText: "确定",-->
<!--          cancelButtonText: "取消",-->
<!--          type: "warning"-->
<!--        }).then(function() {-->
<!--          return exportWithdrawal2(queryParams);-->
<!--        }).then(response => {-->
<!--          this.download(response.msg);-->
<!--        }).catch(function() {});-->
<!--    }-->
<!--  }-->
<!--};-->
<!--</script>-->
